﻿Imports EstoqueDAL
Public Class MenuUsuarioBLL
    Dim objDAL As MenuUsuarioDAL
#Region "Propriedades"
    Property men_codigo As Integer
    Property usu_codigo As Integer
#End Region


#Region "Construtores"
    Sub New()

    End Sub
    Sub New(usuario As Integer, menu As Integer)
        Me.men_codigo = menu
        Me.usu_codigo = usuario
    End Sub
#End Region

#Region "Funções"
#Region "Inserir"
    Sub inserir()
        Try
            objDAL = New MenuUsuarioDAL
            objDAL.inserir(Me.men_codigo, Me.usu_codigo)
        Catch ex As Exception
            Throw ex
        Finally
            objDAL = Nothing
        End Try
    End Sub

#End Region

#Region "Excluir"
    Sub excluir()
        Dim ret As Integer
        Try
            ret = -1
            objDAL = New MenuUsuarioDAL
            ret = objDAL.excluirtodositens(Me.usu_codigo)
        Catch ex As Exception
            Throw ex
        Finally
            objDAL = Nothing
        End Try
    End Sub
#End Region

#Region "Localizar"
    Public Function localizar(codigo As String, tipo As Integer) As DataTable
        Try
            objDAL = New MenuUsuarioDAL
            Return objDAL.buscar(codigo, tipo)
        Catch ex As Exception
            Throw ex
        End Try
    End Function
#End Region

#End Region

#Region "Procedimentos"
#Region "Limpa Propriedades"
    Sub limpar()
        Me.usu_codigo = Nothing
        Me.men_codigo = Nothing
        Me.objDAL = Nothing
    End Sub
#End Region
#End Region
End Class

